import {reqCategoryList} from "@/api";
import {reqGetBannerList} from '@/api';
//home模块
const state={
/*    //储存三级菜单的数据
    categoryList:[],*/
    //轮播图的数据
    bannerList:[]

};
const mutations={
    /*CATEGORYLIST(state,categoryList){
        state.categoryList=categoryList;
    }*/
    GETBANNERLIST(state,bannerList){
        state.bannerList=bannerList;
    }
};
const actions={
  /*  async categoryList({commit}){
        let result =await reqCategoryList();
        //async和await必须同时使用
        if (result.code==200){
            commit("CATEGORYLIST",result.data);
        }
    }*/
    //获取首页轮播图的数据
   async getBannerList({commit}){
        let result=await reqGetBannerList();
        if(result.code==200){
           commit('GETBANNERLIST',result.data);
       }
    }
};
const getter={};
export default {
    state,
    mutations,
    actions,
    getter
}